<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <title></title>
</head>
<body ng-app="myApp">

<div ng-controller="MyController01">
  <input type="text"  ng-model="empName">
  <p>输入的姓名为: {{empName}}</p>

</div>
<div ng-controller="MyController02">
  <input type="text"  ng-model="empName">
  <p>输入的姓名为: {{empName}}</p>

</div>

<script type="text/javascript" src="../../js/angular-1.5.5/angular.js"></script>
<script type="text/javascript">
  /**
   * 先创建模块对象,在创建控制器  angular.module 支持链式调用,返回值为模块对象
   */
  angular.module('myApp',[])
      .controller('MyController01',function ($scope) {  // 隐士声明依赖注入
        $scope.empName = 'kobe';})
      .controller('MyController02',['$scope',function ($scope) { // 显示声明依赖注入 开发中使用
        $scope.empName = 'xaq';}])
</script>
</body>
</html>